import 'package:p_location/home/obj/person_image_info.dart';

class GuestInfoObj {
  String beacon;
  String buildId;
  String carNumber;
  String carType;
  String certificatePic;
  String driverLicense;
  int fireProofingFlag;
  int iconNum;
  int id;
  String identityCard;
  String inOutType;
  String leaveTime;
  String limitSpeed;
  String loadGoodsId;
  String multiDriverJson;
  String name;
  String orgCode;
  String personSn;
  int personTemplateId;
  String personTemplateName;
  PersonImageInfo pic;
  String remark;
  String sex;
  String supercargo;
  String telNumber;
  int tenentId;
  String toolKitId;
  String trackingNumber;
  String vehicleLicencePic;
  String vehicleSn;
  int vehicleTemplateId;
  String vehicleTemplateName;
  int vehicleTypeId;
  String visitReason;
  String visitTime;
  int visitType;
  String workCompanyName;
  String workStatus;

  GuestInfoObj(
      {this.beacon,
      this.buildId,
      this.carNumber,
      this.carType,
      this.certificatePic,
      this.driverLicense,
      this.fireProofingFlag,
      this.iconNum,
      this.id,
      this.identityCard,
      this.inOutType,
      this.leaveTime,
      this.limitSpeed,
      this.loadGoodsId,
      this.multiDriverJson,
      this.name,
      this.orgCode,
      this.personSn,
      this.personTemplateId,
      this.personTemplateName,
      this.pic,
      this.remark,
      this.sex,
      this.supercargo,
      this.telNumber,
      this.tenentId,
      this.toolKitId,
      this.trackingNumber,
      this.vehicleLicencePic,
      this.vehicleSn,
      this.vehicleTemplateId,
      this.vehicleTemplateName,
      this.vehicleTypeId,
      this.visitReason,
      this.visitTime,
      this.visitType,
      this.workCompanyName,
      this.workStatus});

  factory GuestInfoObj.fromJson(Map<String, dynamic> json) {
    return GuestInfoObj(
      beacon: json['beacon'],
      buildId: json['buildId'],
      carNumber: json['carNumber'] ?? "",
      carType: json['carType'] ?? json['type'] ?? "",
      certificatePic: json['certificatePic'],
      driverLicense: json['driverLicense'],
      fireProofingFlag: json['fireProofingFlag'],
      iconNum: json['iconNum'],
      id: json['id'],
      identityCard: json['identityCard'],
      inOutType: json['inOutType'],
      leaveTime: json['leaveTime'],
      limitSpeed: json['limitSpeed'],
      loadGoodsId: json['loadGoodsId'],
      multiDriverJson: json['multiDriverJson'],
      name: json['name'] ?? "",
      orgCode: json['orgCode'],
      personSn: json['personSn'] ?? "",
      personTemplateId: json['personTemplateId'],
      personTemplateName: json['personTemplateName'],
      pic: json['pic'] != null ? PersonImageInfo.fromJson(json['pic']) : null,
      remark: json['remark'] ?? "",
      sex: json['sex'] ?? "",
      supercargo: json['supercargo'],
      telNumber: json['telNumber'] ?? "",
      tenentId: json['tenentId'],
      toolKitId: json['toolKitId'],
      trackingNumber: json['trackingNumber'],
      vehicleLicencePic: json['vehicleLicencePic'],
      vehicleSn: json['vehicleSn'],
      vehicleTemplateId: json['vehicleTemplateId'],
      vehicleTemplateName: json['vehicleTemplateName'],
      vehicleTypeId: json['vehicleTypeId'],
      visitReason: json['visitReason'] ?? "",
      visitTime: json['visitTime'],
      visitType: json['visitType'],
      workCompanyName: json['workCompanyName'],
      workStatus: json['workStatus'],
    );
  }

//    Map<String, dynamic> toJson() {
//        final Map<String, dynamic> data = new Map<String, dynamic>();
//        data['beacon'] = this.beacon;
//        data['buildId'] = this.buildId;
//        data['carNumber'] = this.carNumber;
//        data['carType'] = this.carType;
//        data['certificatePic'] = this.certificatePic;
//        data['driverLicense'] = this.driverLicense;
//        data['fireProofingFlag'] = this.fireProofingFlag;
//        data['iconNum'] = this.iconNum;
//        data['id'] = this.id;
//        data['identityCard'] = this.identityCard;
//        data['inOutType'] = this.inOutType;
//        data['leaveTime'] = this.leaveTime;
//        data['limitSpeed'] = this.limitSpeed;
//        data['loadGoodsId'] = this.loadGoodsId;
//        data['multiDriverJson'] = this.multiDriverJson;
//        data['name'] = this.name;
//        data['orgCode'] = this.orgCode;
//        data['personSn'] = this.personSn;
//        data['personTemplateId'] = this.personTemplateId;
//        data['personTemplateName'] = this.personTemplateName;
//        data['remark'] = this.remark;
//        data['sex'] = this.sex;
//        data['supercargo'] = this.supercargo;
//        data['telNumber'] = this.telNumber;
//        data['tenentId'] = this.tenentId;
//        data['toolKitId'] = this.toolKitId;
//        data['trackingNumber'] = this.trackingNumber;
//        data['vehicleLicencePic'] = this.vehicleLicencePic;
//        data['vehicleSn'] = this.vehicleSn;
//        data['vehicleTemplateId'] = this.vehicleTemplateId;
//        data['vehicleTemplateName'] = this.vehicleTemplateName;
//        data['vehicleTypeId'] = this.vehicleTypeId;
//        data['visitReason'] = this.visitReason;
//        data['visitTime'] = this.visitTime;
//        data['visitType'] = this.visitType;
//        data['workCompanyName'] = this.workCompanyName;
//        data['workStatus'] = this.workStatus;
//        if (this.pic != null) {
//            data['pic'] = this.pic.toJson();
//        }
//        return data;
//    }
}
